/*    */ package btsm.servlet;
/*    */ 
/*    */ import btsm.bean.sqlCableWork;
/*    */ import java.io.IOException;
/*    */ import javax.servlet.RequestDispatcher;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServlet;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ 
/*    */ public class ser_cable extends HttpServlet
/*    */ {
/*    */   public void init()
/*    */     throws ServletException
/*    */   {
/*    */   }
/*    */ 
/*    */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*    */     throws ServletException, IOException
/*    */   {
/* 23 */     sqlCableWork PC = new sqlCableWork("opticalcable", "");
/*    */ 
/* 25 */     String seraction = request.getParameter("seraction");
/* 26 */     String stroccode = request.getParameter("txtoccode");
/* 27 */     String strocname = request.getParameter("txtocname");
/* 28 */     String strsnid = request.getParameter("snid");
/* 29 */     String strToPage = request.getParameter("ToPage");
/* 30 */     if (strToPage == null) {
/* 31 */       strToPage = request.getParameter("tToPage");
/*    */     }
/*    */ 
/* 34 */     if ((strocname != null) && (!strocname.equals(""))) {
/* 35 */       strocname = new String(strocname.getBytes("ISO8859-1"), "utf-8");
/*    */     }
/*    */ 
/* 38 */     request.setAttribute("txtoccode", stroccode);
/* 39 */     request.setAttribute("txtocname", strocname);
/*    */ 
/* 41 */     String filesnames = request.getParameter("filesnames");
/*    */ 
/* 43 */     String msg = "";
/* 44 */     String strRedURL = "common.jsp";
/*    */ 
/* 48 */     if (seraction.equals("seradd")) {
/* 49 */       String[] fieldsg = request.getParameterValues("T1");
/* 50 */       stroccode = fieldsg[0];
/* 51 */       strocname = fieldsg[1];
/*    */ 
/* 53 */       if (PC.InsertRD(fieldsg)) {
/* 54 */         strRedURL = "nnPagesCable.jsp?txtoccode=" + stroccode;
/* 55 */         msg = "新建光缆成功";
/*    */       } else {
/* 57 */         msg = "新建光缆失败";
/*    */       }
/* 59 */     } else if (seraction.equals("sermodp")) {
/* 60 */       request.setAttribute("snid", strsnid);
/* 61 */       if (strToPage == null) {
/* 62 */         strToPage = "1";
/*    */       }
/* 64 */       strRedURL = filesnames + "?txtoccode=" + stroccode + "&txtocname=" + strocname + "ToPage=" + strToPage;
/* 65 */     } else if (seraction.equals("serdel")) {
/* 66 */       PC.wheresw = stroccode;
/* 67 */       if (PC.del())
/* 68 */         msg = "光缆信息删除成功";
/*    */       else {
/* 70 */         msg = "光缆信息删除失败";
/*    */       }
/* 72 */       strsnid = "";
/* 73 */     } else if (seraction.equals("sermod")) {
/* 74 */       String[] fieldxg = request.getParameterValues("T1");
/* 75 */       stroccode = fieldxg[0];
/* 76 */       strocname = fieldxg[1];
/*    */ 
/* 78 */       PC.wheresw = stroccode;
/* 79 */       if (PC.md(fieldxg))
/* 80 */         msg = "光缆信息修改成功";
/*    */       else {
/* 82 */         msg = "光缆信息修改失败";
/*    */       }
/*    */     }
/*    */ 
/* 86 */     PC.dbConClose();
/* 87 */     String filesnamesmd = "ser_cable?seraction=sermodp&txtoccode=" + stroccode + "&txtocname=" + strocname + "&filesnames=" + filesnames + "&snid=" + strsnid + "&ToPage=" + strToPage;
/* 88 */     request.setAttribute("filesnames", filesnamesmd);
/* 89 */     request.setAttribute("msg", msg);
/* 90 */     RequestDispatcher btsm = request.getRequestDispatcher(strRedURL);
/* 91 */     btsm.forward(request, response);
/*    */   }
/*    */ 
/*    */   public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
/*    */   {
/* 96 */     doGet(request, response);
/*    */   }
/*    */ 
/*    */   public void destroy()
/*    */   {
/*    */   }
/*    */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     btsm.servlet.ser_cable
 * JD-Core Version:    0.6.2
 */